package com.fbank.demo.controller;


import com.fbank.demo.dao.TbTradeBaseMapper;
import com.fbank.demo.entity.TbTradeBase;
import com.fbank.middle.pay.api.unionpay.model.BusinessInfoResult;
import com.fbank.middle.pay.api.unionpay.model.BusinessInfoVo;
import com.fbank.middle.pay.api.unionpay.model.BusinessInformParaRequest;
import com.fbank.middle.pay.api.unionpay.service.BusiformAssoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/test/")
public class TestController {

	@Autowired
	private TbTradeBaseMapper tbTradeBaseMapper;

	@Autowired
	private BusiformAssoService busiformAssoService;

	@RequestMapping("getTradeOne")
	//  @RequestParam(value = "remark", required = false) String key
	public TbTradeBase getTradeOne() {
		return  tbTradeBaseMapper.test();
	}

	// dubbo测试
	@RequestMapping("testDubbo")
	public BusinessInfoResult<List<BusinessInfoVo>> testDubbo() {
		BusinessInformParaRequest bps = new BusinessInformParaRequest();
		bps.setPaymentRouter("quickpaymentb2b");
		bps.setConnectionType("0");
		return busiformAssoService.getBusiInfoAssoByPaymentRouter(bps);
	}

}
